/*
 * Copyright (C) 2019-2020 Alibaba Group Holding Limited
 */

#ifndef _BLE_MESH_DEFAULT_CONFIG_H_
#define _BLE_MESH_DEFAULT_CONFIG_H_

#ifdef CONFIG_BT

#ifdef CONFIG_BT_HCI

#if !defined(CONFIG_BT_OBSERVER) || !defined(CONFIG_BT_BROADCASTER)
#error "CONFIG_BT_OBSERVER || CONFIG_BT_BROADCASTER not defined!"
#endif

#ifndef CONFIG_BT_MESH
#define CONFIG_BT_MESH 1
#endif

#ifdef CONFIG_BT_MESH

#ifndef CONFIG_BT_MESH_PB_ADV
#define CONFIG_BT_MESH_PB_ADV 1
#endif

#ifndef CONFIG_BT_MESH_PROV
#ifdef CONFIG_BT_MESH_PB_ADV
#define CONFIG_BT_MESH_PROV 1
#endif
#endif

#ifdef CONFIG_BT_CONN

#ifndef CONFIG_BT_MESH_PB_GATT
//#define CONFIG_BT_MESH_PB_GATT 1
#endif

#ifndef CONFIG_BT_MESH_PROXY
#ifdef CONFIG_BT_MESH_PB_GATT
#define CONFIG_BT_MESH_PROXY 1
#endif
#endif

#ifndef CONFIG_BT_MESH_PROV
#ifdef CONFIG_BT_MESH_PB_GATT
#define CONFIG_BT_MESH_PROV 1
#endif
#endif

#ifndef CONFIG_BT_MESH_GATT_PROXY
//#define CONFIG_BT_MESH_GATT_PROXY 1
#endif

#ifndef CONFIG_BT_PERIPHERAL
#ifdef CONFIG_BT_MESH_GATT_PROXY
#define CONFIG_BT_PERIPHERAL 1
#endif
#endif

#ifndef CONFIG_BT_MESH_PROXY
#ifdef CONFIG_BT_MESH_GATT_PROXY
#define CONFIG_BT_MESH_PROXY 1
#endif
#endif

#ifndef CONFIG_BT_MESH_NODE_ID_TIMEOUT
#ifdef CONFIG_BT_MESH_GATT_PROXY
#define CONFIG_BT_MESH_NODE_ID_TIMEOUT 60
#endif
#endif

#ifdef CONFIG_BT_MESH_PROXY

#ifndef CONFIG_BT_MESH_PROXY_FILTER_SIZE

#ifdef CONFIG_BT_MESH_GATT_PROXY
#define CONFIG_BT_MESH_PROXY_FILTER_SIZE 3
#else
#define CONFIG_BT_MESH_PROXY_FILTER_SIZE 1
#endif

#endif //CONFIG_BT_MESH_PROXY_FILTER_SIZE

#endif //CONFIG_BT_MESH_PROXY

#endif //CONFIG_BT_CONN

#ifndef CONFIG_BT_MESH_SELF_TEST
//#define CONFIG_BT_MESH_SELF_TEST 1
#endif

#ifndef CONFIG_BT_MESH_IV_UPDATE_TEST
//#define CONFIG_BT_MESH_IV_UPDATE_TEST 1
#endif

#ifndef CONFIG_BT_MESH_SUBNET_COUNT
#define CONFIG_BT_MESH_SUBNET_COUNT 1
#endif

#ifndef CONFIG_BT_MESH_APP_KEY_COUNT
#define CONFIG_BT_MESH_APP_KEY_COUNT 2
#endif

#ifndef CONFIG_BT_MESH_MODEL_KEY_COUNT
#define CONFIG_BT_MESH_MODEL_KEY_COUNT 2
#endif

#ifndef CONFIG_BT_MESH_MODEL_GROUP_COUNT
#define CONFIG_BT_MESH_MODEL_GROUP_COUNT 1
#endif

#ifndef CONFIG_BT_MESH_LABEL_COUNT
#define CONFIG_BT_MESH_LABEL_COUNT 1
#endif

#ifndef CONFIG_BT_MESH_CRPL
#define CONFIG_BT_MESH_CRPL 10
#endif

#ifndef CONFIG_BT_MESH_MSG_CACHE_SIZE
/*[Genie begin] add by wenbing.cwb at 2021-08-04*/
#ifdef CONFIG_BT_MESH_NPS_OPT
#define CONFIG_BT_MESH_MSG_CACHE_SIZE 20
#else
#define CONFIG_BT_MESH_MSG_CACHE_SIZE 10
#endif
/*[Genie end] add by wenbing.cwb at 2021-08-04*/
#endif

#ifndef CONFIG_BT_MESH_ADV_BUF_COUNT
/*[Genie begin] add by wenbing.cwb at 2021-08-04*/
#ifdef CONFIG_BT_MESH_NPS_OPT
#define CONFIG_BT_MESH_ADV_BUF_COUNT 20
#else
#define CONFIG_BT_MESH_ADV_BUF_COUNT 9
#endif
/*[Genie end] add by wenbing.cwb at 2021-08-04*/
#endif

#ifndef CONFIG_BT_MESH_IVU_DIVIDER
#define CONFIG_BT_MESH_IVU_DIVIDER 4
#endif

#ifndef CONFIG_BT_MESH_TX_SEG_MSG_COUNT
#define CONFIG_BT_MESH_TX_SEG_MSG_COUNT 1
#endif

#ifndef CONFIG_BT_MESH_RX_SEG_MSG_COUNT
#define CONFIG_BT_MESH_RX_SEG_MSG_COUNT 1
#endif

#ifndef CONFIG_BT_MESH_RX_SDU_MAX
#define CONFIG_BT_MESH_RX_SDU_MAX 72
#endif

#ifndef CONFIG_BT_MESH_TX_SEG_MAX
#define CONFIG_BT_MESH_TX_SEG_MAX (CONFIG_BT_MESH_ADV_BUF_COUNT - 3)
#endif

#ifndef CONFIG_BT_MESH_RELAY
//#define CONFIG_BT_MESH_RELAY 1
#endif

#ifndef CONFIG_BT_MESH_LOW_POWER
//#define CONFIG_BT_MESH_LOW_POWER 1
#endif

#ifdef CONFIG_BT_MESH_LOW_POWER

#ifndef CONFIG_BT_MESH_LPN_ESTABLISHMENT
#define CONFIG_BT_MESH_LPN_ESTABLISHMENT 1
#endif

#ifndef CONFIG_BT_MESH_LPN_AUTO
#define CONFIG_BT_MESH_LPN_AUTO 1
#endif

#ifndef CONFIG_BT_MESH_LPN_AUTO_TIMEOUT
#ifdef CONFIG_BT_MESH_LPN_AUTO
#define CONFIG_BT_MESH_LPN_AUTO_TIMEOUT 15
#endif
#endif

#ifndef CONFIG_BT_MESH_LPN_RETRY_TIMEOUT
#define CONFIG_BT_MESH_LPN_RETRY_TIMEOUT 8
#endif

#ifndef CONFIG_BT_MESH_LPN_RSSI_FACTOR
#define CONFIG_BT_MESH_LPN_RSSI_FACTOR 0
#endif

#ifndef CONFIG_BT_MESH_LPN_RECV_WIN_FACTOR
#define CONFIG_BT_MESH_LPN_RECV_WIN_FACTOR 0
#endif

#ifndef CONFIG_BT_MESH_LPN_MIN_QUEUE_SIZE
#define CONFIG_BT_MESH_LPN_MIN_QUEUE_SIZE 1
#endif

#ifndef CONFIG_BT_MESH_LPN_RECV_DELAY
#define CONFIG_BT_MESH_LPN_RECV_DELAY 100
#endif

#ifndef CONFIG_BT_MESH_LPN_POLL_TIMEOUT
#define CONFIG_BT_MESH_LPN_POLL_TIMEOUT 300
#endif

#ifndef CONFIG_BT_MESH_LPN_INIT_POLL_TIMEOUT
#define CONFIG_BT_MESH_LPN_INIT_POLL_TIMEOUT CONFIG_BT_MESH_LPN_POLL_TIMEOUT
#endif

#ifndef CONFIG_BT_MESH_LPN_SCAN_LATENCY
#define CONFIG_BT_MESH_LPN_SCAN_LATENCY 10
#endif

#ifndef CONFIG_BT_MESH_LPN_GROUPS
#define CONFIG_BT_MESH_LPN_GROUPS 8
#endif

#endif //CONFIG_BT_MESH_LOW_POWER

#ifndef CONFIG_BT_MESH_FRIEND
//#define CONFIG_BT_MESH_FRIEND 1
#endif

#ifdef CONFIG_BT_MESH_FRIEND

#ifndef CONFIG_BT_MESH_FRIEND_RECV_WIN
#define CONFIG_BT_MESH_FRIEND_RECV_WIN 255
#endif

#ifndef CONFIG_BT_MESH_FRIEND_QUEUE_SIZE
#define CONFIG_BT_MESH_FRIEND_QUEUE_SIZE 16
#endif

#ifndef CONFIG_BT_MESH_FRIEND_SUB_LIST_SIZE
#define CONFIG_BT_MESH_FRIEND_SUB_LIST_SIZE 3
#endif

#ifndef CONFIG_BT_MESH_FRIEND_LPN_COUNT
#define CONFIG_BT_MESH_FRIEND_LPN_COUNT 2
#endif

#ifndef CONFIG_BT_MESH_FRIEND_SEG_RX
#define CONFIG_BT_MESH_FRIEND_SEG_RX 1
#endif

#endif //CONFIG_BT_MESH_FRIEND

#ifndef CONFIG_BT_MESH_CFG_CLI
//#define CONFIG_BT_MESH_CFG_CLI 1
#endif

#ifndef CONFIG_BT_MESH_HEALTH_CLI
//#define CONFIG_BT_MESH_HEALTH_CLI 1
#endif

#ifndef CONFIG_BT_MESH_SHELL
//#define CONFIG_BT_MESH_SHELL 1
#endif

#ifdef CONFIG_BT_SETTINGS
#ifndef CONFIG_BT_MESH_STORE_TIMEOUT
#define CONFIG_BT_MESH_STORE_TIMEOUT 2
#endif

#ifndef CONFIG_BT_MESH_SEQ_STORE_RATE
#define CONFIG_BT_MESH_SEQ_STORE_RATE 128
#endif

#ifndef CONFIG_BT_MESH_RPL_STORE_TIMEOUT
#define CONFIG_BT_MESH_RPL_STORE_TIMEOUT 5
#endif

#endif //CONFIG_BT_SETTINGS

#ifndef CONFIG_BT_MESH_DEBUG
//#define CONFIG_BT_MESH_DEBUG 1
#endif

#ifdef CONFIG_BT_MESH_DEBUG

#ifndef CONFIG_BT_MESH_DEBUG_USE_ID_ADDR
//#define CONFIG_BT_MESH_DEBUG_USE_ID_ADDR 1
#endif

#ifndef CONFIG_BT_MESH_DEBUG_NET
//#define CONFIG_BT_MESH_DEBUG_NET 1
#endif

#ifndef CONFIG_BT_MESH_DEBUG_TRANS
//#define CONFIG_BT_MESH_DEBUG_TRANS 1
#endif

#ifndef CONFIG_BT_MESH_DEBUG_BEACON
//#define CONFIG_BT_MESH_DEBUG_BEACON 1
#endif

#ifndef CONFIG_BT_MESH_DEBUG_BEACON
//#define CONFIG_BT_MESH_DEBUG_BEACON 1
#endif

#ifndef CONFIG_BT_MESH_DEBUG_CRYPTO
//#define CONFIG_BT_MESH_DEBUG_CRYPTO 1
#endif

#ifndef CONFIG_BT_MESH_DEBUG_PROV
//#define CONFIG_BT_MESH_DEBUG_PROV 1
#endif

#ifndef CONFIG_BT_MESH_DEBUG_ACCESS
//#define CONFIG_BT_MESH_DEBUG_ACCESS 1
#endif

#ifndef CONFIG_BT_MESH_DEBUG_MODEL
//#define CONFIG_BT_MESH_DEBUG_MODEL 1
#endif

#ifndef CONFIG_BT_MESH_DEBUG_ADV
//#define CONFIG_BT_MESH_DEBUG_ADV 1
#endif

#ifndef CONFIG_BT_MESH_DEBUG_LOW_POWER
//#define CONFIG_BT_MESH_DEBUG_LOW_POWER 1
#endif

#ifndef CONFIG_BT_MESH_DEBUG_FRIEND
//#define CONFIG_BT_MESH_DEBUG_FRIEND 1
#endif

#ifndef CONFIG_BT_MESH_DEBUG_PROXY
//#define CONFIG_BT_MESH_DEBUG_PROXY 1
#endif

#ifndef CONFIG_BT_MESH_DEBUG_SETTINGS
//#define CONFIG_BT_MESH_DEBUG_SETTINGS 1
#endif

#endif //CONFIG_BT_MESH_DEBUG

#ifndef CONFIG_BT_MESH_PROVISIONER
//#define CONFIG_BT_MESH_PROVISIONER 1
#endif

#ifdef CONFIG_BT_MESH_PROVISIONER

#ifndef CONFIG_BT_MESH_PROVISIONER_APP_KEY_COUNT
#define CONFIG_BT_MESH_PROVISIONER_APP_KEY_COUNT 3
#endif

#ifndef CONFIG_BT_MESH_PROVISIONER_SUBNET_COUNT
#define CONFIG_BT_MESH_PROVISIONER_SUBNET_COUNT 3
#endif

#ifndef CONFIG_BT_MESH_MAX_PROV_NODES
#define CONFIG_BT_MESH_MAX_PROV_NODES 10
#endif

#ifndef CONFIG_BT_MESH_MAX_STORED_NODES
#define CONFIG_BT_MESH_MAX_STORED_NODES 10
#endif

#ifndef CONFIG_BT_CENTRAL
#define CONFIG_BT_CENTRAL 1
#endif

#ifndef CONFIG_BT_GATT_CLIENT
#define CONFIG_BT_GATT_CLIENT 1
#endif

#endif //CONFIG_BT_MESH_PROVISIONER

#endif //CONFIG_BT_MESH

#endif //CONFIG_BT_HCI

#endif //CONFIG_BT

#endif //_BLE_MESH_DEFAULT_CONFIG_H_